import { defineStore } from 'pinia'


export const useThemeStore = defineStore('theme', {
    state: () => ({
        isDark: localStorage.getItem('theme') === 'dark'
    }),
    actions: {
        toggleDarkMode() {
            this.isDark = !this.isDark
            localStorage.setItem('theme', this.isDark ? 'dark' : 'light')
        }
    },
    persist: true
})